const SET_LANG = 'SET_LANG'

export const state = () => {
  return {
    locales: ['zh_CN', 'zh_TW', 'en_US'],
    locale: 'zh_CN'
  }
}

export const actions = {
  setLocale({ commit }, payload) {
    commit(SET_LANG, payload)
  }
}

export const mutations = {
  SET_LANG(state, locale) {
    state.locale = locale
  }
}
